#ifndef SPLINE_H
#define SPLINE_H
#include <QVector>

class Spline
{
public:
    Spline();
    ~Spline();
    void Init(const QVector<double> & vx_in,const QVector<double> & vy_in);
    double GetInterPol(double x_om);
private:
    void	SortData();
    void	CalDiff();
    void	SetBoundCondtion();
    void	CalDiaFactor();
    void	Cal1stDun(QVector<double> &vA_in,QVector<double> &vC_in,QVector<double> &vR_in);
    void	Fastsort(QVector<double> &array, int begin, int end);
private:
    int			m_nSize;
    double		m_dDy0;
    double		m_dDyn;
    QVector<double>		m_vx;		// 插值基x
    QVector<double>		m_vy;		// 差值基y
    QVector<double>		m_vDx;		// 基差
    QVector<double>		m_vDf;		// 差值基导数
};

#endif // SPLINE_H
